#ifndef __TIM_H__
#define __TIM_H__
#include "main.h"
/* 
    Note:
        TIM2 用于 sysTick（系统时钟被FreeRTOS占用）
        TIM3 用于 CANOpen中断
 */
/* 宏定义 --------------------------------------------------------------------*/
/* CANOpen定时 */
#define CANOPEN_TIMx              TIM3
#define CANOPEN_TIM_IRQn          TIM3_IRQn
#define CANOPEN_TIM_Priority      12
#define CANOPEN_TIM_IRQ_Handler   TIM3_IRQHandler

/* 
    1khz(1ms) = 72 x 10^6 / 72000  1mhz(1us) = 72 x 10^6 / 72
 */
#define CANOPEN_TIM_PRESCALER_VALUE         72 - 1          
#define CANOPEN_TIM_PERIOD                  1000 - 1         //定时周期
#define CANOPEN_TXMAILBOX  CAN_TX_MAILBOX0
#define HAL_CANOPEN_TIMx htim3

extern TIM_HandleTypeDef htim3;
void TIM3_Init(void);
#endif /*__TIM_H__*/